/**
 * Created with IntelliJ IDEA
 * Description:
 * User:恋恋
 * Date:2023-02-27
 * Time:20:22
 */
//public class TsetDemo {
//    private static int count;
//    private static  String[] stops = new String[]{"Washington","Monroe","Jackson","LaSalle"};
//
//    public static void main(String[] args) {
//        while (count < stops.length){
//            if(stops[count++].length() < 8){
//                break;
//            }
//        }
//        //java中获取数组长度和字符串长度
//        //数组长度-length属性获取
//        //字符串长度-length()方法获取
//        String str = "hello world";
//        System.out.println(str.length());
//        System.out.println(stops.length);
//        System.out.println(count);
//    }
//}
 class Test1 {
    public static void main(String[] args) {
        int num = 10;
        final int num2 = 20;
        switch (num){
            case num2:
                System.out.println(5);
                break;
            default:
                System.out.println("default");
        }
    }
}
class Test2 {
    public static void main(String[] args) {
        int num = 20;
        final int num2 = 30;
       // num2 = 30;
        switch(num){
            case num2: System.out.println(4);
                break;
            default:
                System.out.println("default");
        }
    }

}
class Test4{
    public static void main(String[] args) {
        int num = 120;
        switch (num){
            default:
                System.out.println("d");
            case 0:
                System.out.println("c1");
            case 10*2-10:
                System.out.println("c2");
        }
    }
}
class Test5{
     public double numbers(long arg1 , long arg2 , long arg3){
         return arg1 + arg2 + arg3 ;
     }
    public static void main(String[] args) {
        int i = 0;
        for( ; i < 2 ; i = i + 5 ){
            if ( i < 5 )continue;
            System.out.println(i);
        }
        System.out.println(i);
    }
}
class Animal{
     void jump(){
         System.out.println("Animal");
     }
}
class Cat extends Animal{
     //父子之间形成了重载
     void jump(int a){
         System.out.println("cat");
     }
     void sleep(){
         System.out.println("睡觉");
     }
}
class Rabbit extends Animal{
     //父子之间形成了重写
     void jump(){
         System.out.println("Rabbit");
     }
}
public class Test{
    public static void main(String[] args) {
        Animal cat = new Cat();
        cat.jump();

      //  cat.sleep();//这里就不能访问子类特用的方法，若想访问就需要向下转型
    }
        }